/*
*	Copyright (C) 2014  Julio Montes, Mario Carrillo
*
*	Julio Montes e-mail: imc.coder@gmail.com
*
*	Mario Carrillo e-mail: mario_90ago@live.com.mx
*
*	BSD 3-Clause License
*/

#ifndef SDK_EDITORMANAGER_H
#define SDK_EDITORMANAGER_H

#include <wx/wx.h>

#include "sdk/include/mgr.h"

namespace sdk
{
    class Editor;
    class NotebookEditor;

    class EditorManager : public sdk::Mgr<EditorManager>
    {
    public:
        enum ID
        {
            ID_NOTEBOOKEDITOR = 501
        };

        EditorManager();

        virtual ~EditorManager();

        int FindEditor( const wxString &fileName ) const;

        bool SaveEditorAs();

        bool SaveCurrentEditor();

        bool SaveAllEditors();

        bool SaveEditor( const wxString &fileName );

        bool SaveEditor( sdk::Editor *editor );

        bool CloseCurrentEditor();

        bool CloseAllEditors();

        bool CloseEditor( const wxString &fileName );

        bool CloseEditor( sdk::Editor *editor );

        sdk::Editor *GetCurrentEditor() const;

        sdk::Editor *GetEditor( const wxString &fileName ) const;

        void OpenFile( const wxString &fileName, const wxString &title=wxEmptyString, const wxBitmap &image=wxNullBitmap );

        void NewFile();

        int SetSelectionEditor( const wxString &fileName );

        NotebookEditor *GetNotebookEditor() const;
    protected:
    private:
        NotebookEditor *m_notebookEditor;
    };
}

#endif // SDK_EDITORMANAGER_H
